<?php
ob_start();
define('PHPFOX', true);
define('PHPFOX_NO_SESSION',true);
define('PHPFOX_NO_USER_SESSION',true);
define('PHPFOX_DS', DIRECTORY_SEPARATOR);
define('PHPFOX_DIR', dirname(dirname(dirname(dirname(__FILE__)))) . PHPFOX_DS);
include PHPFOX_DIR .PHPFOX_DS.'include'.PHPFOX_DS.'init.inc.php';
$iId = isset($_GET['id']) ? $_GET['id'] : 0;
$iLimit = isset($_GET['limit']) ? $_GET['limit'] : 10;
$iPage = isset($_GET['page']) ? $_GET['page'] : 1;
$iOffset = ($iPage - 1) * $iLimit;
$aConds = array();
if ($iId > 0)
{
    $aConds[] = 'AND queue_id = ' . $iId;
}
$aRows = Phpfox::getLib('phpfox.database')->select('*')
    ->from(Phpfox::getT('contactimporter_queue'))
    ->where($aConds)
    ->limit($iOffset, $iLimit)
    ->order('queue_id ASC')    
    ->execute('getRows');    
print_r($aRows);

$aConds = array();
$iYear = date('Y', PHPFOX_TIME);
$iMonth = date('m', PHPFOX_TIME);
$iDay = date('d', PHPFOX_TIME);        
$iStartTimeOnDate = mktime(0, 0, 0, $iMonth, $iDay, $iYear);
$iEndTimeOnDate = mktime(23, 59, 59, $iMonth, $iDay, $iYear);
$aConds[] = "AND time_stamp >= $iStartTimeOnDate AND time_stamp <= $iEndTimeOnDate";
$aDailys = Phpfox::getLib('phpfox.database')->select('*')
    ->from(Phpfox::getT('contactimporter_queue_daily'))
    ->where($aConds)    
    ->execute('getRows'); 
echo '<br/><hr/>';    
print_r($aDailys);    
?>